package com.oracle.rentcar.mapper;

import com.oracle.rentcar.pojo.Customer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface CustomerMapper {

    //查询会员
    List<Customer> selectCustomer();

    //删除会员
    int deleteCustomer(Integer id);

    //批量删除
    int bathDeleteCustomer(List<Integer> customerIds);

    //返回会员记录数， long类型
    long countCustomer();

    //根据会员id查找会员
    Customer findCustomer(Integer id);

    // 根据会员编号修改会员

    void updateCustomerById(Customer customer);
    //检查会员名是否存在

    Customer checkCustomerName(@Param("customerName") String cusName);
    //动态的多条件查询会员(电话、名字)

    List<Map<String, Object>> selectCustomerByParams(@Param("customerName") String cusName, @Param("mobile") String phone);
    //会员登陆

    Customer customerLogin(@Param("customerName") String cusName, @Param("password") String password);

    //注册会员
    int addCustomer(Customer customer);
}
